#!/bin/bash
# 备份验证脚本

echo "验证备份完整性..."

# 检查必要文件
required_files=(
    "ifconfig.txt"
    "network_services.txt" 
    "dns_config.txt"
    "routing_table.txt"
    "hosts.txt"
    "redis_server_info.txt"
)

missing_files=()
for file in "${required_files[@]}"; do
    if [ ! -f "$file" ]; then
        missing_files+=("$file")
    fi
done

if [ ${#missing_files[@]} -eq 0 ]; then
    echo "✅ 所有必要文件都已备份"
else
    echo "❌ 缺少以下文件:"
    for file in "${missing_files[@]}"; do
        echo "  - $file"
    done
fi

# 检查SystemConfiguration目录
if [ -d "SystemConfiguration" ]; then
    echo "✅ SystemConfiguration目录已备份"
    echo "  包含 $(ls SystemConfiguration | wc -l) 个配置文件"
else
    echo "❌ SystemConfiguration目录未备份"
fi

# 统计代理配置文件
proxy_files=$(ls proxy_*.txt 2>/dev/null | wc -l)
echo "✅ 备份了 $proxy_files 个代理配置文件"

echo ""
echo "备份验证完成"
